//
//  AppDelegate.m
//  <13> Alert
//
//  Created by chen on 16/9/18.
//  Copyright © 2016年 tyrad. All rights reserved.
//

#import "AppDelegate.h"

@interface AppDelegate ()

@property (weak) IBOutlet NSWindow *window;
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    
   // NSRunAlertPanel(<#NSString *title#>, <#NSString *msgFormat#>, <#NSString *defaultButton#>, <#NSString *alternateButton#>, <#NSString *otherButton, ...#>)
    
    // */
    //APPKIT_EXTERN NSInteger NSRunAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) NS_FORMAT_FUNCTION(2,6) NS_DEPRECATED_MAC(10_0, 10_10, "Use NSAlert instead");

    //NSAlert *alert = [[NSAlert alloc]init];
    
 
    
    //NSInteger choice =  NSRunAlertPanel(@"Titile", @"message", @"default btn", @"alert btn", @"other btn");
    
    NSRunAlertPanel(@"message ", @"支持format %@", @"cc", @"aa", @"bb", @"额外信息messagee");
    
    
    
    //表示哪个按钮被点击了
    //NSLog(@"%@",@(choice));
    
    
    NSAlert *alert = [[NSAlert alloc] init];
    
    [alert addButtonWithTitle:@"OK"];
    
    [alert addButtonWithTitle:@"Cancel"];
    
    [alert setMessageText:@"Delete the record?"];
    
    [alert setInformativeText:@"Deleted records cannot be restored."];
    
    [alert setAlertStyle:NSWarningAlertStyle];
    
   // static const NSAlertStyle NSWarningAlertStyle API_DEPRECATED_WITH_REPLACEMENT("NSAlertStyleWarning", macosx(10.3, 10.12)) = NSAlertStyleWarning;
   // static const NSAlertStyle NSInformationalAlertStyle API_DEPRECATED_WITH_REPLACEMENT("NSAlertStyleInformational", macosx(10.3, 10.12)) = NSAlertStyleInformational;
   // static const NSAlertStyle NSCriticalAlertStyle
    //实现帮助主题按钮
    
    [alert setShowsHelp:YES];
    
    
    [alert beginSheetModalForWindow:_window completionHandler:^(NSModalResponse returnCode) {
        
    }];
    
}





- (void)applicationWillTerminate:(NSNotification *)aNotification {
    // Insert code here to tear down your application
}


@end
